package com.rpcfx.server;

import com.rpcfx.api.RegistryCenterService;
import com.rpcfx.api.RpcfxResolver;

/**
 * @ProjectName: learning
 * @Package: com.rpcfx.server
 * @ClassName: RpcfxResolverImpl
 * @Description:
 * @Date: 2021/11/11 11:01 下午
 * @Version: 1.0
 */
public class RpcfxResolverImpl implements RpcfxResolver {


    private RegistryCenterService registryCenterService;


    public RpcfxResolverImpl(RegistryCenterService registryCenterService) {
        this.registryCenterService = registryCenterService;
    }

    @Override
    public Object resolve(String serviceClass) {
        Class<?> aClass = registryCenterService.getClass(serviceClass);
        return ObjectFactory.getObject(aClass);
    }
}
